import Vue from 'vue'
import Vuex from 'vuex'
import persistedState from 'vuex-persistedstate'
Vue.use(Vuex)
const state = {
  count: 1,
  //{date:"",time:"",info:""}
  timerInfo: []
}
const store = new Vuex.Store({
  plugins: [
    // persistedState({
    //   key: 'store',
    //   storage: {
    //     getItem: (key) => uni.getStorageSync(key),
    //     setItem: (key, value) => uni.setStorageSync(key, value),
    //     removeItem: (key) => uni.removeStorageSync(key)
    //   },
    //   render(state) {
    //     return { count: state.count, timerInfo: state.timerInfo }
    //   }
    // })
  ],
  state: state,
  getters: {
    timerInfo: (state) => {
      return state.timerInfo
    },
    count: (state) => {
      return state.count
    }
  },
  mutations: {
    increment(state) {
      // state.count++
    }
  },
  actions: {}
})
export default store
